//
//  options.m
//  MainMenu
//
//  Created by Mr. Steptoe on 2/21/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "OptionsVC.h"
#import "Sound.h"

@implementation OptionsVC
@synthesize switch1;
@synthesize switch2;
@synthesize switch3;
//-(IBAction)musicOn{
//	[Sound soundEffect:6];
//	//[myMusic play];
//}
//-(IBAction)musicOff{
//	[Sound soundEffect:7];
//	//[myMusic stop];
//}
-(IBAction)soundOff:(id)sender{
	[Sound soundEffect:2];
}

-(IBAction)soundOn:(id)sender{
	[Sound soundEffect:3];
}
-(IBAction)music1:(id)sender{
	[Sound soundEffect:4];
}

-(IBAction)music2:(id)sender{
	[Sound soundEffect:5];
}


-(IBAction)goBackButtonPressed:(id)sender{
	NSLog(@"Go back button pressed!");
	[self dismissModalViewControllerAnimated:YES];
}
- (IBAction) toggleEnabledForSwitch1{
	/**
	if(switch2.on){
			//Do nothing, there should not be 2 musics playing at once.
	}else{
	 **/
		if(switch1.on){
			[switch1 setOn:YES animated:YES];
			[Sound soundEffect:6];
		}else{
			[switch1 setOn:NO animated:YES];
			[Sound soundEffect:7];
		}
}
/**
- (IBAction) toggleEnabledForSwitch2{
		if(switch2.on){
			[switch2 setOn:YES animated:YES];
			[Sound soundEffect:5];
		}else{
			[switch2 setOn:NO animated:YES];
			[Sound soundEffect:4];
		}
}
**/
- (IBAction) toggleEnabledForSwitch3{
	if(switch3.on){
		[switch3 setOn:YES animated:YES];
		[Sound soundEffect:3];
	}else{
		[switch3 setOn:NO animated:YES];
		[Sound soundEffect:2];
		
	}
	
	
}

/*
 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
 if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
 // Custom initialization
 }
 return self;
 }
 */


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
	//[Sound initMusic];
	
	if([Sound checkIfSoundPlaying]){
			[switch1 setOn:YES animated:NO];
	} else {
			[switch1 setOn:NO animated:NO];
	}
	 
	if([Sound checkIfSoundOn]){
		[switch3 setOn:YES animated:NO];
	} else {
		[switch3 setOn:NO animated:NO];
	}
	
	[super viewDidLoad];
}


/*
 // Override to allow orientations other than the default portrait orientation.
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 // Return YES for supported orientations
 return (interfaceOrientation == UIInterfaceOrientationPortrait);
 }
 */

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}


@end
